<template>
  <van-notice-bar
    :left-icon='leftIcon' v-if='noticeData'>
    {{noticeData.content}}
  </van-notice-bar>
</template>

<script>
  import {Toast} from 'vant'
  import Api from '@/axios'

  export default {
    name: 'marquee',
    data() {
      return {
        leftIcon: require('../../assets/img/icon02.png'),
        noticeData: null
      }
    },
    methods: {
      // 获取跑马灯
      getMessagedata() {
        Api.getMessage().then(res => {
          let result = res.data
          if (result.code === 0) {
            this.noticeData = result.data
          }
        })
      }
    },
    mounted() {
      this.getMessagedata()
    }
  }
</script>

<style scoped>

</style>
